package driver

import "gorm.io/plugin/dbresolver"

type ConnPoolPolicy string

const (
	RandomPolicy ConnPoolPolicy = "random"
)

var connPoolPolicy = map[ConnPoolPolicy]dbresolver.Policy{
	RandomPolicy: dbresolver.RandomPolicy{},
}

func GetPolicy(p ConnPoolPolicy) (dbresolver.Policy, bool) {
	policy, ok := connPoolPolicy[p]
	return policy, ok
}
